//import 'package:amap_base/amap_base.dart';

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_hotwork/HomePage.dart';
import 'package:flutter_hotwork/homepage/BaseTitleBar.dart';
import 'package:flutter_hotwork/homepage/BaseViewBar.dart';
import 'package:flutter_hotwork/utils/DioUtils.dart';
// import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';

import '../Myapplication.dart';
import 'TongJiAllHuiZong.dart';
import 'TongJiYongHuRi.dart';
import 'TongJiYongHuRiHZ.dart';

class tongjibaobiaoribiaoPage extends StatefulWidget {
  @override
  tongjibaobiaoribiaoState createState() => new tongjibaobiaoribiaoState();
}

class tongjibaobiaoribiaoState extends State<tongjibaobiaoribiaoPage> {

  @override
  void initState() {
    super.initState();
    DioUtils.createInstance();
  }

  @override
  void dispose() {
//    _amapLocation.stopLocate();
    super.dispose();
  }

  TabController _tabController;

  @override
  Widget build(BuildContext context) {
    double rpx = MediaQuery.of(context).size.height / 750;
    return Scaffold(
      body:
      Container(
        child:
        DefaultTabController(
          length: MyApplication.loginuserinfo.userInfo.amHotuser == 0 ? 3 : 2,
          child:
          Column(
            children:[
              TabBar(
                labelColor: Colors.blue,
                unselectedLabelColor: Colors.black,
                indicatorColor: Colors.blue,
                tabs:  MyApplication.loginuserinfo.userInfo.amHotuser == 0
                    ? <Widget>[
                  Tab(text: "用户日报表"),
                  Tab(text: "日汇总报表"),
                  Tab(text: "ALL日报表"),
                ]
                    : <Widget>[
                  Tab(text: "用户日报表"),
                  Tab(text: "日汇总报表"),
                ],
                controller: _tabController,  // 记得要带上tabController
              ),
              Container(
                height: rpx*525,
                // height: double.maxFinite,
                child:
                TabBarView(
                  controller: _tabController,
                  children:  MyApplication.loginuserinfo.userInfo.amHotuser == 0
                      ? <Widget>[
                    Center(
                      child: tongjibaobiaoyonghuribiaoPage(),
                    ),
                    Center(
                      child: tongjibaobiaoyonghurihuizongbiaoPage(),
                    ),
                    Center(
                      child: tongjibaobiaoallzongbiaoPage(),
                    ),
                  ]
                      : <Widget>[
                    Center(
                      child: tongjibaobiaoyonghuribiaoPage(),
                    ),
                    Center(
                      child: tongjibaobiaoyonghurihuizongbiaoPage(),
                    ),
                  ],
                ),
              ),

            ],
          ),
        ),
      ),
    );
  }


}






















